package com.jwsoft.manager.core.gateway.controller;

import com.bifang.assistant.common.constants.Validators;
import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.protect.core.annotation.Idempotent;
import com.github.pagehelper.PageInfo;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj01.EduBigscreenZbtj01KeyVO;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj01.EduBigscreenZbtj01QueryVO;
import com.jwsoft.manager.common.vo.eduBigscreenZbtj01.EduBigscreenZbtj01VO;
import com.jwsoft.manager.core.integration.EduBigscreenZbtj01Integration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 新生报名大屏指标统计01（第一张 地址）网关
 *
 * @author linyh
 * @since 2023-04-24
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "新生报名大屏指标统计01（第一张 地址）", description = "新生报名大屏指标统计01（第一张 地址）")
public class EduBigscreenZbtj01Controller {

    @Autowired
    public EduBigscreenZbtj01Integration eduBigscreenZbtj01Integration;

    @Operation(summary = "新生报名大屏指标统计01（第一张 地址）分页查询",description = "新生报名大屏指标统计01（第一张 地址）分页查询")
    @PostMapping(value = "/eduBigscreenZbtj010001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduBigscreenZbtj01VO>> getList(@RequestBody @Validated EduBigscreenZbtj01QueryVO vo) {
        return AppResponse.successData(eduBigscreenZbtj01Integration.getList(vo));
    }

    @Operation(summary = "新生报名大屏指标统计01（第一张 地址）根据主键查询详情",description = "新生报名大屏指标统计01（第一张 地址）根据主键查询详情")
    @PostMapping(value = "/eduBigscreenZbtj010002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj01VO> getById(@RequestBody @Validated EduBigscreenZbtj01KeyVO vo) {
        return AppResponse.successData(eduBigscreenZbtj01Integration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计01（第一张 地址）新增",description = "新生报名大屏指标统计01（第一张 地址）新增")
    @PostMapping(value = "/eduBigscreenZbtj010004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj01VO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduBigscreenZbtj01VO vo) {
        return AppResponse.successData(eduBigscreenZbtj01Integration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计01（第一张 地址）修改",description = "新生报名大屏指标统计01（第一张 地址）修改")
    @PostMapping(value = "/eduBigscreenZbtj010005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenZbtj01VO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduBigscreenZbtj01VO vo) {
        return AppResponse.successData(eduBigscreenZbtj01Integration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "新生报名大屏指标统计01（第一张 地址）删除",description = "新生报名大屏指标统计01（第一张 地址）删除")
    @PostMapping(value = "/eduBigscreenZbtj010006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduBigscreenZbtj01KeyVO vo) {
        eduBigscreenZbtj01Integration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
